﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterNhanSuTienLuong.Master" Inherits="System.Web.Mvc.ViewPage<DTTB.MV2.QUANLYNHANSUTIENLUONG.Models.FormBean.DanhMuc.TienBoiDuongForm>" %>
<%@ Import Namespace="DTTB.MV2.QUANLYNHANSUTIENLUONG.Models.LinQ.DanhMuc" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" language="javascript" src="<%= ResolveUrl("~/Content/Scripts/DanhMuc/TienBoiDuong.js") %>"></script>
    
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $("#TienBoiDuongSearch").focus();
            selectMenu("DanhMucChung-TienBoiDuong");
            $("#DanhMucChung-TienBoiDuong").parent().attr("class", "expanded");
            $("#IdSoKm").change(function () {
                var IdKm = $("#IdSoKm").val();
                var url = basePath + 'DanhMuc/SelectBuoinAjax?id=' + IdKm;
                $.getJSON(url, null, function (data) {
                    var str = "<select id=\"IdBuoi\" name=\"IdBuoi\" style=\"width:365px\"><option value=\"\">----- Chọn buổi -----</option>";
                    for (var i = 0; i < data.length; i++) {
                        str += "<option value='" + data[i].Value + "'>" + data[i].Name + "</option>";
                    }
                    str += "</select>";
                    document.getElementById("cboBuoi").innerHTML = str;
                });
             });

        });

        

    </script>

    <form id="form" method="post" action="#" class="formBox">

    <input type="hidden" id="Id" name="Id" value="<%=Model.Id %>" />
    <%=Html.Hidden("PageNumber", Model.Pagenumber)%>
    

    <div class="box">
           <div class="breadcrumbs">
          <ul>
            <li class="home"><a href="">Quản lý Danh mục</a></li>
            <li><a href="">Danh mục Tiền bồi dưỡng</a></li>
            <li>Page</li>
          </ul>
        </div>
           <div class="headlines">
            <h2>
                <span>Danh mục Tiền bồi dưỡng</span>
            </h2>
               <%-- <a class="show-filter" href="#">show filter</a>--%>
        </div>
       
        <table class="table_outsite" width="100%">
            <tr>
                <td>
            <%--Thông Báo--%>
            <%
                if (!string.IsNullOrEmpty(Model.MessageCreateTienBoiDuong))
                {
            %>
            <div id="MessageCreateTienBoiDuong" style="font-size: 12px; color: Blue; font-weight: bold"><%=Model.MessageCreateTienBoiDuong%></div>
            <%
                }
            %>
            <%
                if (!string.IsNullOrEmpty(Model.Message))
                {
            %>
            <div id="Message" style="font-size: 12px; color: Blue; font-weight: bold"><%=Model.Message%></div>
            <%}
            %>
            <%
                if (!string.IsNullOrEmpty(Model.MessageEditTienBoiDuong))
                {
            %>
            <div id="MessageEditTienBoiDuong" style="font-size: 12px; color: Blue;font-weight: bold"><%=Model.MessageEditTienBoiDuong%></div>
            <%
                }
            %>
            <%--end--%>
                </td>
                <td style="text-align:right" class="btn-submit">
                    <input type="button" class="button" value="Lưu" onclick="DoCreateOrEdit()" />
                    <input type="button" class="button"value="Thêm Mới" onclick="javascript:DoNew();" />
                    <input type="button" class="button"value="Xóa" onclick="javascript:DoDelete();" />
                    <input type="button" class="button"value="Làm Mới" onclick="javascript:DoReset();" />
                    <input type="button" class="button"value="Dữ liệu đã xóa" onclick="javascript:ToRecycle();" />
                </td>
            </tr>        
        </table >

     <table class="table_input" width="100%"> 
            <tr>
                <td nowrap="nowrap" style="width:11%" class="lab">
                    <b>Chọn số Km:</b>
                </td>
                <td>
                <%=Html.DropDownList("IdSoKm", Model.cboSoKm, "----- Chọn số  Km -----", new { Style = "width:365px"})%>
                    <div id="IdSoKmMessage" class="red"></div>
                </td>
            </tr>
             <tr>
                <td nowrap="nowrap" style="width:11%" class="lab">
                    <b>Tên tỉnh :</b>
                </td>
                <td >
                    <div id="cboBuoi"><%=Html.DropDownList("IdBuoi",Model.cboBuoi,"----- Chọn buổi -----", new { Style = "width:365px" })%>
                    </div><div id="IdBuoiMessage" class="red"></div>
                </td>
            </tr>
             <tr>
                <td nowrap="nowrap" style="width:11%" class="lab">
                    <b>Số tiền:</b>
                </td>
                <td>
                    <input style="width: 40%" type="text" onkeyup="javascript:keyupChiNhapSo(this)" value="<%=Model.SoTien%>" id="SoTien" name="SoTien" />
                    <div id="SoTienMessage" class="red"></div>
                </td>
            </tr>
        </table>
        <div class="pagebreak">&nbsp;</div>
        <table class="table_outsite" width="100%">
            
        <tr>
            
            <td class="first" align="right">
                <%=Html.TextBox("TienBoiDuongSearch", Model.valuesearch, new { @size = 50, @onkeypress = "if (event.keyCode==13) { return DoSearch(); }" })%>
                <img onclick="javascript:DoSearch();" style="vertical-align: middle; cursor: pointer"
                    src="<%=ResolveUrl("~/Content/Images/search_icon.gif")%>" alt="Tìm kiếm Dân tộc"
                    title="Tìm kiếm Dân tộc" />
                     <div id="SearchMessage" class="red"></div>
            </td>
        </tr>
        </table>
        <table  class="tab tab-drag">
                        <tr class="top nodrop nodrag" style="font-weight: bold">
                            <td class="first" width="20%" align="center">
                                <strong>Số thứ tự</strong>
                            </td>
                             <td >
                                <strong>Số Km</strong>
                            </td>
                             <td >
                                <strong>Buổi</strong>
                            </td>
                            <td class="last">
                                <strong>Số tiền</strong>
                            </td>
                        </tr>
                        <%--Danhd Muc TienBoiDuong List--%>
                        <%
                                
                            IList<dm_TienBoiDuong> TienBoiDuongList = Model.TienBoiDuongPagedList;
                            int t = (Model.Pagenumber - 1) * DTTB.Common.CommonVariables.PaggedItemsPerPage;
                            foreach (dm_TienBoiDuong item in TienBoiDuongList)
                            {
                                t++;
                        %>
                        <tr class="item_row" onclick="javascript:highlight(this);EditTienBoiDuongAjax(<%=item.Id%>);">
                            <td class="first" align="center">
                                <%=t %>
                            </td>
                            <td >
                                <%=item.dm_SoKm.Name%>
                            </td>
                            <td >
                                <%=item.dm_Buoi.Name%>
                            </td>
                            <td align="left" class="last">
                                <%=item.SoTien!=null?item.SoTien.Value.ToString("#,#0").Replace(",",".")+" VNĐ":""%>
                            </td>
                        </tr>
                        <%}
                        %>
                        <tr class="border_bottom">
                            <%--                                <td class="first" style="background: #DDDDDD">
                                </td>--%>
                            <td class="last" colspan="4" align="right" style="background: #DDDDDD; padding-right: 10px">
                                <%
                                    PagerOptions pagerOptions = new PagerOptions();
                                    DTTB.MV2.QUANLYNHANSUTIENLUONG.BussinessDelegate.CommonDelegate.CommonDelegate CommonDelegate =
                                            new DTTB.MV2.QUANLYNHANSUTIENLUONG.BussinessDelegate.CommonDelegate.CommonDelegate();

                                    CommonDelegate.ChangeTextPaging(pagerOptions, "PageNumber");
                                         
                                %>
                                <div>
                                    <%=Html.Pager(Model.TienBoiDuongPagedList, pagerOptions, "Default1", new object())%></div>
                                <%=Html.Hidden("PageNumber", Model.Pagenumber)%>
                            </td>
                        </tr>
                        <%--dã xóa--%>
                    </table>
        
        <%-- </div>--%>
    </div>
    <%--<%Html.EndForm(); %>--%>
    <div id="dialog-ThuongKm">
    
    </div>
    </form>
</asp:Content>
